package com.mygame.client.service.handler.codec;

import com.mygame.common.protobuf.ExternalMessage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

public class ResponseHandler extends ChannelInboundHandlerAdapter {

    public ResponseHandler() {
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
//        GameMessagePackage messagePackage = (GameMessagePackage) msg;
//        int messageId = messagePackage.getHeader().getMessageId();
//
//        IGameMessage gameMessage = RequestCmd.find(messageId).clientRsp;
//        gameMessage.setHeader(messagePackage.getHeader());
//        gameMessage.read(messagePackage.getBody());
//        ctx.fireChannelRead(gameMessage);
        ExternalMessage messagePackage = (ExternalMessage) msg;
        ctx.fireChannelRead(messagePackage);
    }
}
